
#include "model.h"
#include "core.h"

using namespace Blox;

void Blox::Model::Load( char const * const pFileName )
{
	//////////////////////////////////////////////////////////////////////////
	// Temp load.

	// Make a cube!
	m_uVertCount = 8;

	m_pVertList = (InputVert*)malloc( sizeof(InputVert)*m_uVertCount );
	m_pVertList[0] = InputVert( Vec( -1.0f, -1.0f, -1.0f ), Col::WHITE.c32 );
	m_pVertList[1] = InputVert( Vec( -1.0f, -1.0f,  1.0f ), Col::WHITE.c32 );
	m_pVertList[2] = InputVert( Vec( -1.0f,  1.0f, -1.0f ), Col::WHITE.c32 );
	m_pVertList[3] = InputVert( Vec( -1.0f,  1.0f,  1.0f ), Col::WHITE.c32 );
	m_pVertList[4] = InputVert( Vec(  1.0f, -1.0f, -1.0f ), Col::WHITE.c32 );
	m_pVertList[5] = InputVert( Vec(  1.0f, -1.0f,  1.0f ), Col::WHITE.c32 );
	m_pVertList[6] = InputVert( Vec(  1.0f,  1.0f, -1.0f ), Col::WHITE.c32 );
	m_pVertList[7] = InputVert( Vec(  1.0f,  1.0f,  1.0f ), Col::WHITE.c32 );
	
	m_uIndexTopology = 2/*D3D10_PRIMITIVE_TOPOLOGY_LINELIST*/;

	m_uIndexCount = 24;

	m_pIndexList = (u32*)malloc( sizeof(InputVert)*m_uVertCount );
	m_pIndexList[0] = 0;
	m_pIndexList[1] = 1;
	m_pIndexList[2] = 2;
	m_pIndexList[3] = 3;
	m_pIndexList[4] = 0;
	m_pIndexList[5] = 2;
	m_pIndexList[6] = 1;
	m_pIndexList[7] = 3;
	m_pIndexList[8] = 4;
	m_pIndexList[9] = 5;
	m_pIndexList[10] = 6;
	m_pIndexList[11] = 7;
	m_pIndexList[12] = 4;
	m_pIndexList[13] = 6;
	m_pIndexList[14] = 5;
	m_pIndexList[15] = 7;
	m_pIndexList[16] = 0;
	m_pIndexList[17] = 4;
	m_pIndexList[18] = 1;
	m_pIndexList[19] = 5;
	m_pIndexList[20] = 2;
	m_pIndexList[21] = 6;
	m_pIndexList[22] = 3;
	m_pIndexList[23] = 7;

}

